from datetime import date;
import time

class tempo():

  def Datas(self,x,y):
    i = 0;
    f = 0;
    while x[f] != '/':
        f = f + 1;
    di = int(x[i:f]);
    i = f + 1;
    f = i;
    while x[f] != '/':
        f = f + 1;
    mi = int(x[i:f]);
    i = f + 1;
    f = i;
    while f <= len(x):
        f = f + 1;
    ai = int(x[i:f]);
    i = 0;
    f = 0;
    while y[f] != '/':
        f = f + 1;
    df = int(y[i:f]);
    i = f + 1;
    f = i;
    while y[f] != '/':
        f = f + 1;
    mf = int(y[i:f]);
    i = f + 1;
    f = i;
    while f <= len(x):
        f = f + 1;
    af = int(y[i:f]);
    data1 = date(af,mf,df);
    data0 = date(ai,mi,di);
    difDias = data1 - data0;
    return difDias.days;    

  def DiaAtual(self):

    AnoCalendario=str(time.localtime()[0])
    MesCalendario=str(time.localtime()[1])
    DiaCalendario=str(time.localtime()[2]) 

    if len(DiaCalendario)==1:
        DiaCalendario="0"+DiaCalendario

    if len(MesCalendario)==1:
        MesCalendario="0"+MesCalendario
        
    return DiaCalendario+"/"+MesCalendario+"/"+AnoCalendario
